<?php

namespace App\Http\Requests\Api;

use Illuminate\Foundation\Http\FormRequest;

class RentClothPostRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'rent_id' => 'required',
            'content' => 'required|min:8|max:200',
            'post_img' => 'required',
        ];
    }

    public function messages()
    {
        return [
            'rent_id.required' => '缺少参数rent_id',

            'content.required' => '请输入评价内容',
            'content.min' => '评价内容最少8字',
            'content.max' => '评价内容最多200字',

            'post_img.required' => '请选择图片',
            // 'post_img.array' => '图片格式错误',
        ];
    }

}
